﻿
$(document).ready(function () {
    $("#reg_username").JQP_TxtTips({ txt: "请输入你的常用邮箱，如：example@example.com<br />它将成为你未来的登录帐号", VailFn: checkMail, plusId: "red_reg_username" });
    $("#reg_password").JQP_TxtTips({ txt: "密码由6-16位半角字符（字母、数字、符号）组成，区分大小写", VailFn: checkPwd, plusId: "red_reg_password" });
    $("#reg_password2").JQP_TxtTips({ txt: "这里要重复下你的密码", VailFn: checkRePwd, plusId: "red_reg_password2" });
    $("#door").JQP_TxtTips({ txt: "验证码是又字母和数字组成，不区分大小写", VailFn: checkVailCode, plusId: "red_door" });
    $("#after").JQP_TxtTips({ VailFn: checkIsAgree, plusId: "red_after", isTxtInput: false });
    $("#reg_username").JQP_EmailNote({ selfn: function () { $("#reg_username").focusout(); $("#reg_username").blur(); $("#reg_password").focusin(); $("#reg_password").focus(); } });
    $(".jh_yanzheng").focusin(function () { $(this).attr("class", "jh_yanzhenghover"); });
    $(".jh_yanzheng").focusout(function () { $(this).attr("class", "jh_yanzheng"); });
    $(".r_loginbtn").bind("click", function (e) { App.showLoginDial(e); return false });

    $("#submit").click(function (e) {
        App.disableAtag($(this), "btn_ljzc_load");
        checkIsAgree($("#after"), $("#red_after"));
        checkMail($("#reg_username"), $("#red_reg_username"), false);
        checkPwd($("#reg_password"), $("#red_reg_password"));
        checkRePwd($("#reg_password2"), $("#red_reg_password2"));
        checkVailCode($("#door"), $("#red_door"), false);
        if (isMail && isAgree && isPwd && isRePwd && isVailCode) {
            App.iframeSubmit({ formMail: $("#reg_username").val(), formPwd: $("#reg_password").val() }, "RegForm", "/User/IframeReg/", "RegIframe");
        }
        else {
            App.enableAtag($(this));
        }
        return false;
    });
});
  